

$(function(){
  $('.setStart').each(function(i,n){
    setScoreImg(n);
  })
})



var mySwiper = new Swiper('.swiper-container', {
  autoplay: 3000,//可选选项，自动滑动
  loop: true
})

/**
 * 服务星级评分
 */
function setScoreImg(obj){
  var temp = $(obj).data('score');

  var score = Math.floor(temp);
    console.log(score)
  var html='';
  for(var i=1;i<=5;i++){
      if(i<=score){
          html+='<img src="/Tpl/Wx/image/icon_star_1@2x.png" width="100%" height="100%">';
      }else if(temp*1+0.5>=i){
          html+='<img src="/Tpl/Wx/image/icon_star_05@2x.png" width="100%" height="100%">';
      }else{
          html+='<img src="/Tpl/Wx/image/icon_star_0@2x.png" width="100%" height="100%">';

      }
  }
  $(obj).html(html);
}

